import {Component} from '@angular/core';
import {NavController} from 'ionic-angular';
import { NavParams } from 'ionic-angular';
import { ViewController } from 'ionic-angular';
import { Platform } from 'ionic-angular';


//  http请求
import {Http,Headers} from '@angular/http';
// import {interfaceUrls} from '../../../provider/serverUrls';
import 'rxjs/add/operator/toPromise';
import 'rxjs/add/operator/timeout';
//通过手机号查询到的数据传递到已存在的经销商页面
@Component({
    selector: 'page-product2', 
    templateUrl: 'product2.html'
})
export class productPage2 {
	
    product:any;  
    constructor(
    			public navCtrl: NavController,
    			public http:Http,
    			public platform: Platform,
			    public navParams: NavParams,
			    public viewCtrl: ViewController
    			) {
    		//接受从contact页面传递过来的产品信息
    		this.product=this.navParams.get('product');
    		console.log(this.product);
    }
//返回产品信息页面
    dismiss() {
    	this.viewCtrl.dismiss();
  	}
    
	check(e){
		console.info(e.target.innerHTML)
		this.product[0].productName = e.target.innerHTML;
    	this.viewCtrl.dismiss();
		
	}
    
}